<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 
        清除浮动
            clear:left; 清除左边的浮动
            clear:right; 清除右边的浮动
            clear:both; 清除两边的浮动
            clear:none; 不清

        clear:使当前元素不受上边浮动元素的影响
     -->
     <style>
         .box1{
             float:left;
         }
         .box2{
             float:right;
         }
     </style>
</head>
<body>
    <div class="box">
        <div class="box1"></div>
        <div class="box2"></div>
    </div>
    <div class="footer"></div>
</body>
</html>